<include file='Public:head'/>
<include file='Public:header'/>
    <div class="container" style="margin-top:60px;">
            <div class="row">
                <div class="span12">
                    <h2 class=""><a href="{:U(GROUP_NAME . '/Circle/circle', array('c_id' => $thesis['d_id']))}">{$thesis.docname}</a></h2>
                    <ul class="myul">
                        <li>
                        {$thesis.content|htmlspecialchars_decode|stripslashes}
                        <div class="text-right">
                            <a href=""><label for="">{$thesis.username}</label></a>
                            <label for="">{$thesis.createtime}</label>
                        </div>
                        </li>
                    </ul>
                </div> 
            </div>
            <div class="row">
                <textarea style="width:100%;height:20px;opacity:0" name="" id="fabiaokuang" cols="30" rows="10"></textarea>
            </div>
            <div class="row text-right">
                <button stat='1' id="fabiao" class="btn">发表见解</button>
                <button id="yes" class="btn">确认发送</button>
            </div>
            <div class="row">
                <div class="span12">
                    <table class="blocking">
                        <tr>
                            <td rowspan="2" class="info">
                                <img src="__PUBLIC__/imgs/default_head_img.jpg" class="img-polaroid">
                                <p><b>用户名：</b>admin</p>
                                <p><b>贡献词条数：</b>100</p>
                                <p><b>角色：</b>圈主</p>
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>
                                <textarea index='1' name=""  placeholder='我也说一句' id="" cols="30" rows="10"></textarea>
                                <input value="发送" type="button" index='2'>
                            </td>
                        </tr>
                        <tr>
                            <td class="info" rowspan="2">
                                <img src="__PUBLIC__/imgs/default_head_img.jpg" class="img-polaroid">
                                <p><b>用户名：</b>admin</p>
                                <p><b>贡献词条数：</b>100</p>
                                <p><b>角色：</b>圈主</p>
                            </td>
                            <td>
                                
                                <p><b>admin：</b>楼主好人1218525419@qq.com！~</p>
                                <ul index='2'>
                                    <li><b>shao：</b>你个屌丝&nbsp;&nbsp;<a href="javascript::;" index='2' class="req" href="">回复</a></li>
                                    <li><b>ming：</b>+1&nbsp;&nbsp;<a href="javascript::;" index='2' class="req" href="">回复</a></li>
                                    <li><b>quan：</b>+1&nbsp;&nbsp;<a href="javascript::;" index='2' class="req" href="">回复</a></li>
                                </ul>
                                    
                                
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <textarea index='2' name=""  placeholder='我也说一句' id="" cols="30" rows="10"></textarea>
                                <input value="发送" type="button" index='2'>
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="2" class="info">
                                <img src="__PUBLIC__/imgs/default_head_img.jpg" class="img-polaroid">
                                <p><b>用户名：</b>admin</p>
                                <p><b>贡献词条数：</b>100</p>
                                <p><b>角色：</b>圈主</p>
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>
                                <textarea index='3' name=""  placeholder='我也说一句' id="" cols="30" rows="10"></textarea>
                                <input value="发送" type="button" index='2'>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
            
    </div>
<include file='Public:footer/'>
<script>
    $(function(){
        var if_follow=false;
        var donnot=false
        var to_follow=null;
        $('.req').each(function(){
            $(this).click(function(){
                $('textarea[index='+$(this).attr('index')+']').animate({
                    height:'60px'
                }).focus();
                debugger
                donnot=true;
                to_follow=$(this).parent();
            })
        })
        $('.blocking textarea').click(function(){
            if(donnot){
                donnot=!donnot;
                return;
            }
            $(this).animate({
                height:'60px'
            })
            if_follow=true;
        }).blur(function(){
            $(this).animate({
                height:'20px'
            })
        })
        $('input[type=button]').click(function(){
            /*后台发数据*/
            if(if_follow){
                var li = $('<li><b>username：</b>'+$('textarea[index='+$(this).attr('index')+']').val()+'<a href="javascript::;" index=\'2\' class="req" href="">回复</a></li></li>')
                $('ul[index='+$(this).attr('index')+']').append(li);
            }
            else{
                to_follow.after('<li><b>username：</b>'+$('textarea[index='+$(this).attr('index')+']').val()+'<a href="javascript::;" index=\'2\' class="req" href="">回复</a></li></li>')
            }
        })
        $('#fabiao').click(function(){
            if($(this).attr('stat')=='1'){
                $(this).attr('stat','0');
                $('#fabiaokuang').animate({
                    height:'80px',
                    opacity:1
                })

            }else{
                $(this).attr('stat','1');
                $('#fabiaokuang').animate({
                    height:'20px',
                    opacity:0
                })
            }
        })
        $('#yes').click(function(){
            if($('#fabiaokuang').val().length>15){
                var ne=$("<tr>"+
                    "<td rowspan=\"2\" class=\"info\">"+
                        "<img src=\"__PUBLIC__/imgs/default_head_img.jpg\" class=\"img-polaroid\">"+
                        "<p><b>用户名：</b>admin</p>"+
                        "<p><b>贡献词条数：</b>100</p>"+
                        "<p><b>角色：</b>圈主</p>"+
                    "</td>"+
                    "<td><ul>"+$('#fabiaokuang').val()+"</ul></td>"+
                "</tr>"+
                "<tr>"+
                    "<td>"+
                        "<textarea index='2' name=\"\"  placeholder='我也说一句' id=\"\" cols=\"30\" rows=\"10\"></textarea>"+
                        "<input type=\"button\" index='2'>"+
                    "</td>"+
                "</tr>");
                debugger
                $('.blocking').eq(0).find('tbody').eq(0).append(ne);
                $('#fabiaokuang').val('');
            }else{
                alert('评论请不要低于十五字');
            }
        })
    })
</script>
<style>
    
  .myul li{
    display: block;
    width: 95%;
    border-radius: 3px;
    border: 1px dashed #ccc;
    height: auto;
    /*line-height: 40px;*/
    margin-top: 8px;
    padding:10px;
    padding-left: 8px;
    color: gray;
    /*font-size: 18px;*/
    background: #eee;
  }
  .blocking{
    width: 100%;
  }
  .blocking tr:nth-child(2n){
    border-bottom: 1px solid #ccc;
    /*margin-top: 8px;*/
  }
  .blocking img{
    margin-bottom: 8px;
  }
  .blocking textarea{
    height: 20px;
    width: 80%;
    margin-left: 5%;
    margin-bottom: -3px;   
  }
  .blocking .info{
    width: 120px;
    border-right: 1px solid #ccc;
    padding: 8px;
    position: relative;
  }
  .blocking p{
    padding-left: 8px;
  }
  .blocking li{
    list-style: none;
  }
</style>